<?php

namespace App\Formats;

use App\Common\Libs\ArrayHelper;

class RecommendSystemFormat extends BaseFormat
{
    public const SQUARE_RECOMMEND_LIST = 'squareRecommendList';

    public function formatRecommendSystemList($targetIdArr, $currentUserId, $formatScene)
    {
        switch ($formatScene) {
            case self::SQUARE_RECOMMEND_LIST:
                return self::formatBySquareRecommendList($targetIdArr, $currentUserId);

        }

        return [];
    }

    public static function formatBySquareRecommendList($targetIdArr, $currentUserId)
    {
        $articleList = formats()->ArticleFormat->formatArticleList($targetIdArr['article'], $currentUserId, ArticleFormat::SQUARE_RECOMMEND_LIST);

        $noteList = formats()->NoteFormat->formatNoteList($targetIdArr['note'], $currentUserId, NoteFormat::SQUARE_RECOMMEND_LIST);

        return ArrayHelper::merge($articleList, $noteList);
    }
}
